package com.idbk.chargestation.bean;

import java.util.Locale;

import com.google.gson.annotations.SerializedName;

public class JsonQrScanTariff {
	
	@SerializedName("id")
	public int id;//此资费策略
	
	@SerializedName("agentId")
	public int agentId;//代理商Id

	@SerializedName("priceName")
	public String priceName;//电价名称
	
	@SerializedName("servicePrice")
	public int servicePrice;//服务费
	
	@SerializedName("serviceTypeEnum")
	public int serviceTypeEnum;//服务类型
	
	@SerializedName("price1")
	public int price1;//尖峰电价
	
	@SerializedName("price2")
	public int price2;//高峰电价
	
	@SerializedName("price3")
	public int price3;//平谷电价
	
	@SerializedName("price4")
	public int price4;//低谷电价
	
	@SerializedName("priceCommon")
	public double priceCommon;//通用电价
	
	@SerializedName("time1StartAt")
	public String time1StartAt;//时间段1
	
	@SerializedName("time2StartAt")
	public String time2StartAt;//时间段2
	
	@SerializedName("time3StartAt")
	public String time3StartAt;//时间段3
	
	@SerializedName("time4StartAt")
	public String time4StartAt;//时间段4
	
	@SerializedName("time5StartAt")
	public String time5StartAt;//时间段5
	
	@SerializedName("time6StartAt")
	public String time6StartAt;//时间段6
	
	@SerializedName("time7StartAt")
	public String time7StartAt;//时间段7
	
	@SerializedName("time8StartAt")
	public String time8StartAt;//时间段8
	
	@SerializedName("time9StartAt")
	public String time9StartAt;//时间段9
	
	@SerializedName("time10StartAt")
	public String time10StartAt;//时间段10
	
	@SerializedName("time11StartAt")
	public String time11StartAt;//时间段11
	
	@SerializedName("time12StartAt")
	public String time12StartAt;//时间段12
	
	@SerializedName("time1PriceCode")
	public int time1PriceCode;//时间段1电价编号
	
	@SerializedName("time2PriceCode")
	public int time2PriceCode;//时间段2电价编号
	
	@SerializedName("time3PriceCode")
	public int time3PriceCode;//时间段3电价编号
	
	@SerializedName("time4PriceCode")
	public int time4PriceCode;//时间段4电价编号
	
	@SerializedName("time5PriceCode")
	public int time5PriceCode;//时间段5电价编号
	
	@SerializedName("time6PriceCode")
	public int time6PriceCode;//时间段6电价编号
	
	@SerializedName("time7PriceCode")
	public int time7PriceCode;//时间段7电价编号
	
	@SerializedName("time8PriceCode")
	public int time8PriceCode;//时间段8电价编号
	
	@SerializedName("time9PriceCode")
	public int time9PriceCode;//时间段9电价编号
	
	@SerializedName("time10PriceCode")
	public int time10PriceCode;//时间段10电价编号
	
	@SerializedName("time11PriceCode")
	public int time11PriceCode;//时间段11电价编号
	
	@SerializedName("time12PriceCode")
	public int time12PriceCode;//时间段12电价编号

	
	/**
	 * 获取通用电价（元）
	 * @return
	 */
	public String getCommonPriceString(){
		return String.format(Locale.CHINA,"%.2f", priceCommon/100d);
	}
	
	/**
	 * 获取分时段 的电价
	 * @param index 电价标号
	 * @return
	 */
	public String getSplitTimePriceInfo(int index){
		if(index == 1){
			return String.format(Locale.CHINA, "%.2f", price1 / 100d);
		} else if(index == 2){
			return String.format(Locale.CHINA, "%.2f", price2 / 100d);
		} else if(index == 3){
			return String.format(Locale.CHINA, "%.2f", price3 / 100d);
		} else if(index == 4){
			return String.format(Locale.CHINA, "%.2f", price4 / 100d);
		} else {
			return "N/A";
		}
	}
	
}
